package com.example.demo.service;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "OgAPI", url = "${feign.og.url}")
public interface OgService {
    @Autowired

    @RequestMapping(value = "/v1/sequencer", method = RequestMethod.GET)
    String latestBlock();

    @RequestMapping(value = "transaction_hashes", method = RequestMethod.GET)
    String txByHeight(@RequestParam("height") int height);

    @RequestMapping(value = "transaction", method = RequestMethod.GET)
    String txByHash(@RequestParam("hash") String hash);

    @RequestMapping(value = "sequencer", method = RequestMethod.GET)
    String blockById(@RequestParam("id") int id);

    @RequestMapping(value = "consensus", method = RequestMethod.GET)
    String nodeNumber();

    @RequestMapping(value = "ledger_size",method = RequestMethod.GET)
    String ledgerSize();
}
